﻿@{
    ViewBag.Title = "ActionPower";
    Layout = Url.Content("~/Areas/_Shared/_Layout.cshtml");
}
@section head
{
    <script src="@Url.Content("~/ScriptPlugin/validate/validate.js")"></script>
    <link href="@Url.Content("~/ScriptPlugin/validate/validate.css")" rel="stylesheet" />
    <style type="text/css">
        button {
            margin-top: 10px;
            margin-bottom: 10px;
        }
    </style>
}
<div class="content-form">
    <table class="content-table">
        <tr>
            <th><span>自定义名称</span></th>
            <td>
                <input type="text" data-validate-option="isNull" id="Name" name="Name" />
            </td>
            <th><span>代码</span></th>
            <td>
                <input type="text" data-validate-option="isNull" id="Code" name="Code" />
            </td>
        </tr>
        <tr>
            <th>系统默认</th>
            <td colspan="3">
                <button type="button" data-options="insert:新增" class="u-btn u-btn-c4">新增</button>
                <button type="button" data-options="delete:删除" data- class="u-btn u-btn-c4">删除</button>
                <button type="button" data-options="update:编辑" class="u-btn u-btn-c4">编辑</button>
                <button type="button" data-options="print:打印" class="u-btn u-btn-c4">打印</button>
                <button type="button" data-options="import:导入" class="u-btn u-btn-c4">导入</button>
                <button type="button" data-options="down:导出" class="u-btn u-btn-c4">导出</button>
            </td>
        </tr>
    </table>

</div>
@section foot
{
    <script type="text/javascript">
        function SaveData(index)
        {
            if (K.Validate())
            {
                var dto = { Name: $("#Name").val(), Code: $("#Code").val() };
                parent.K.layer.callback(index, dto);
                parent.K.layer.close(index);
            }
        }
        $("button").click(function () {
            var options = $(this).attr("data-options").split(':');
            var dto = { Name: options[1], Code: options[0] };
            var index = parent.K.layer.getFrameIndex(window.name);
            parent.K.layer.callback(index, dto);
        })
    </script>
}